package org.ccay.manage.log.service;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

import org.ccay.core.exception.ApplicationException;
import org.ccay.core.server.ServerInfoVO;
import org.ccay.log.ServerLogVO;


/**
 * server log service
 * 
 * @author chaowangbang
 * 
 */
@Path("/serverLog")
@Produces("application/json")
public interface IServerLogService {

	/**
	 * Get log File lists by server name
	 * 
	 * @param servername
	 * @return List <LogFileInfoVO>
	 */
	@GET
	@Path("/fileList/{servername}/{serverNameHashcode}")
	public List<ServerLogVO> findLogList(@PathParam("serverNameHashcode") int serverNameHashcode,@PathParam("servername") String servername) throws ApplicationException;

	/**
	 * Get server lists and first server's filelist
	 * 
	 * @return List <string>
	 * @throws ApplicationException
	 */
	@GET
	@Path("/serverList")
	public List<ServerInfoVO> findServerList() throws ApplicationException;
	
	/**
	 * 测试目录创建权限 
	 * 	@author chaowangbang
	 * @since 2012-8-8
	 * @throws ApplicationException
	 */
	@POST
	@Path("/test")
	public void testCreateLog() throws ApplicationException;
	/**
	 * 根据服务的hashcode找到服务名称
	 * @param serverNameHashcode
	 * @return
	 * @throws ApplicationException
	 */
	public String findServerName(int serverNameHashcode) throws ApplicationException;
	/**
	 * 根据服务名称的hashcode和日志文件的hashcode来查找日志文件名
	 * @param serverNameHashcode
	 * @param logNameHashcode
	 * @return
	 * @throws ApplicationException
	 */
	public String findLogFileName(int serverNameHashcode,int logNameHashcode) throws ApplicationException;
	
}